<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
import { isNowDate } from "@/utils/common";
export default {
  name: "app",
  created() {
    this.init();
    // setAllScreen(false,document)
  },
  methods: {
    init() {
      let bgck = localStorage.getItem("bgck");
      if (!bgck)
        localStorage.setItem(
          "bgck",
          Math.floor(Math.random() * 0xffffff).toString(16)
        );

      let nowDate = localStorage.getItem("nowDate");
      let phoneGetCodeNK = {
        setPassword: {},
        transforPassword: {},
        resetPassword: {},
        register: {},
      };

      if (!nowDate) {
        localStorage.setItem("nowDate", +new Date());
        localStorage.setItem("phoneGetCodeNK", JSON.stringify(phoneGetCodeNK));
      } else {
        if (!isNowDate(Number(nowDate))) {
          localStorage.setItem("nowDate", +new Date());
          localStorage.setItem(
            "phoneGetCodeNK",
            JSON.stringify(phoneGetCodeNK)
          );
        }
      }
    },
  },
};
</script>

<style lang="less">
@import url("./assets/less/rest.less");
@import url("./assets/less/common.less");
</style>
